package com.dd.keel.core.framework.protocol;

import com.dd.keel.core.framework.server.ServerHeartbeatHandler;

/**
 * handle heartbeat
 * @author Kevin.XU
 *
 */
public class SoaServerHeartbeatHandler implements ServerHeartbeatHandler{

	@Override
	public boolean isHeartBeat(Object requestObj) 
	{
		SoaMsg requestMsg = (SoaMsg)requestObj;
		if(requestMsg.getType()==0x01)
		{
			return true;
		}
		return false;
	}
	
	@Override
	public Object produceHeartbeatResponse(Object requestObj) 
	{
		SoaMsg requestMsg = (SoaMsg)requestObj;
		requestMsg.setType(SoaMsg.getResponseType(requestMsg.getType()));
		return requestMsg;
	}

}
